#!/bin/sh
#
# Copyright (C) 2000-2022 Kern Sibbald
# License: BSD 2-Clause; see file LICENSE-FOSS
#
# Create a very slow job so that I can stop jobs cancel
#   jobs and restart jobs for testing.
#
TestName="slow-test"
JobName=Incremental 
. scripts/functions

${rscripts}/cleanup
${rscripts}/copy-test-confs
echo "${cwd}/build" >${tmp}/file-list

change_jobname CompressedTest $JobName
start_test

cat <<END_OF_DATA >${tmp}/bconcmds
@output /dev/null
messages
@$out ${tmp}/log1.out
@#setdebug level=100 storage=File1
@#setdebug level=200 client
@#setdebug level=100 director
label storage=File1 volume=TestVolume001 slot=1 drive=0
label storage=File1 volume=TestVolume002 slot=1 drive=0
setbandwidth client=$CLIENT limit="100 kb/s"
run job=$JobName yes
status client
wait
run job=$JobName yes
messages
quit
END_OF_DATA

run_bacula

check_for_zombie_jobs storage=File1
#stop_bacula

check_two_logs
#
# Delete .c files because we will only restored the txt files
#
#rm -f ${tmpsrc}/*.c
#check_restore_tmp_build_diff
#end_test
